<template>
  <div>
    <h1>name:{{ name() }}</h1>
    <h1>name2:{{ name2() }}</h1>
  </div>
</template>

<script>
import { ref, reactive, toRefs } from "vue";
export default {
  setup() {
    let p = reactive({
      name: () => "李狗蛋",
    });
    let name2 = ref(() => "李铁柱");

    return { ...toRefs(p), name2 };
  },
};
</script>

<style>
</style>